import request from '@/utils/request'

export const getListAPI = function (params) {
  return request({
    params
  })
}

// 新增
export const postListAPI = function (data) {
  return request({
    method: 'post',
    data
  })
}

// 编辑获取详情
export const getUpdateListAPI = function (id) {
  return request({
    url: `${id}`
  })
}

// 编辑
export const updateListAPI = function (data) {
  return request({
    url: `${data.id}`,
    method: 'put',
    data
  })
}

// 删除
export const delListAPI = function (id) {
  return request({
    url: `${id}`,
    method: 'DELETE'
  })
}

// 搜索
export const searchListAPI = function (name) {
  return request({
    url: `?name=${name}`
  })
}
